<?PHP 
include("config.php");
 ?>
 <?PHP include("config.php");
require_once "sql_inject.php"; 
$bDestroy_session = TRUE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect)  ; 
require 'config.php';
?>
<script language="JavaScript">
 function blockError(){return true;}
 window.onerror = blockError;
 </script>
<script language=JavaScript>
 function disableselect(e) {
    return false
 } 
 function reEnable() {
    return true
 }
 //if IE4+
 document.onselectstart=new Function ("return false")
 //if NS6
 if (window.sidebar) { 
    document.onmousedown=disableselect
    document.onclick=reEnable
 }
 </script>
<SCRIPT language=JavaScript>
<!--

var message="Gosto do site né safado! ta querendo copiar o que?";


function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 
</SCRIPT>
<html>
<head>
<title>logar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
</SCRIPT>
</head>

<body background="imagens/fundonews.gif">
<?php
require 'config.php';
require_once "sql_inject.php"; 

$bDestroy_session = FALSE; 
$url_redirect = 'index.php'; 
$sqlinject = new sql_inject('./log_file_sql.log',$bDestroy_session,$url_redirect) ; 

$pass = stripslashes($_POST['senha']);
$pass = htmlspecialchars($pass,ENT_QUOTES);
$login = stripslashes($_POST['login']);
$login = htmlspecialchars($login,ENT_QUOTES);

$sql_username_check = "SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'";
$sqlinject->test($sql_username_check); 
$sql_username_check = mssql_query($sql_username_check); 
$username_check 	= mssql_num_rows($sql_username_check); 

$sql_pass_check = "SELECT memb__pwd FROM MEMB_INFO WHERE memb__pwd='$pass' AND memb___id = '$login'";
$sqlinject->test($sql_pass_check); 
$sql_pass_check = mssql_query($sql_pass_check); 
$pass_check = mssql_num_rows($sql_pass_check); 

if (empty($login) || empty($pass) || ($username_check <= 0) || ($pass_check <= 0))
{
	echo '<body bgcolor="none" text="#006699" link="#006699" vlink="#006699" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><p align="center">Erro:</p><br>';
	if (empty($login) || empty($pass))
		echo '<p align="center">Campos em branco. Preencha todos os campos corretamente.<br><br>
		<a href="mznews/news.php">Clique aqui para voltar.</a></p>';
	elseif (($username_check <= 0) || ($pass_check <= 0))
		echo '<p align="center">Login/Senha incorreto(s). Preencha os campos corretamente.<br><br>
		<a href="mznews/news.php" target="main">Clique aqui para voltar.</a></p>';
}
else
{
	$SQL_Verift = mssql_query( "SELECT * FROM AccountCharacter WHERE Id = '$login'");
	$Resultado = mssql_fetch_object( $SQL_Verift );
	$VipPlace = $Resultado->vip;
	if ( $VipPlace == "" )
	{
		echo "<script>;window.location='resets.php';</script>";
	} else {
		echo "<script>window.alert(\"Olá VIP! Aguarde...\");window.location='manager.php'</script>";
	}
	$sql_nome = "SELECT memb_name FROM MEMB_INFO WHERE memb___id='$login'";
	$sqlinject->test($sql_nome); 
	$sql_nome = mssql_query($sql_nome); 
	$nome = mssql_result($sql_nome, 0,0);

	$sql_mail = "SELECT mail_addr FROM MEMB_INFO WHERE memb___id='$login'";
	$sqlinject->test($sql_mail); 
	$sql_mail = mssql_query($sql_mail); 
	$email = mssql_result($sql_mail, 0,0);

	setcookie("login", $login);
	setcookie("pass", $pass);
	setcookie("nome", $nome);
	setcookie("email", $email);

	echo '<body bgcolor="none" text="#006699" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	<p align="center"><br><br><br><br><br><BR><BR><br><br><size="10" face="Verdana><b>Aguarde, carregando dados...<br>
	<meta http-equiv="refresh" content="1; URL=manager.php"> 
	</p>';
}
?>
</body>
</html>
